Skip to content

Upgrade LVGL to v9 and adapt project code to new APIs#104

Merged
zjwhitehead merged 4 commits intomasterfrom
lvglv9
Mar 27, 2026
Merged

Upgrade LVGL to v9 and adapt project code to new APIs#104
zjwhitehead merged 4 commits intomasterfrom
lvglv9

Conversation

@zjwhitehead
Copy link
Copy Markdown
Member

This pull request upgrades the LVGL graphics library from v8 to v9 and updates the codebase to be compatible with the new version. The changes include significant updates to configuration files, buffer management, widget usage, and image asset handling. Additionally, there are minor improvements and corrections in alert handling and test settings.

LVGL v9 Upgrade and Compatibility Updates:

  • Upgraded LVGL from version 8.4.0 to 9.5.0 in platformio.ini, requiring extensive configuration and API changes throughout the codebase.
  • Updated lv_conf.h for v9 compatibility: revised color depth options, memory and OS settings, draw engine and buffer configurations, widget usage macros (renamed and added new widgets), and removed deprecated settings. [1] [2] [3] [4] [5] [6] [7] [8]

Buffer and Display Driver Changes:

  • Changed buffer allocation and display driver variables to match LVGL v9's API: now uses byte-based buffers (LVGL_BUF_BYTES), and updates display driver types from lv_disp_drv_t to lv_display_t*. [1] [2]
  • Updated display flush callback and related function signatures for v9 API changes.

Image Asset Structure Updates:

  • Updated image asset structures to match LVGL v9's lv_image_dsc_t format, including changes to header fields and buffer pointers. [1] [2] [3]

Widget and Alert Handling Improvements:

  • Updated alert and label visibility logic to use lv_obj_remove_flag instead of the deprecated lv_obj_clear_flag. [1] [2] [3] [4] [5]
  • Corrected variable types for widget positioning to match new API expectations.

Testing and Miscellaneous:

  • Added new test command patterns to .claude/settings.local.json for PlatformIO testing and running.

These changes collectively ensure the project is compatible with LVGL v9, improve maintainability, and enable new features and widgets provided by the updated library.

Bump LVGL to v9 (platformio.ini) and update project code and config to the v9 API and data structures. Changes include: lv_conf.h rewritten for LVGL v9 config macros and memory/OS settings; switch from legacy lv_disp/lv_draw_buf APIs to lv_display-based APIs and byte-based buffers (LVGL_BUF_BYTES); update flush callback signature and usage (lv_display_flush_ready, px_map), use lv_timer_handler; convert image assets and descriptors to lv_image_dsc_t with new header/.data/.data_size fields; rename image and spinner APIs (lv_img_* -> lv_image_*, lv_spinner_set_anim_params); replace deprecated functions/types (lv_obj_clear_flag -> lv_obj_remove_flag, lv_obj_set_style_img_recolor -> lv_obj_set_style_image_recolor, lv_scr_load -> lv_screen_load, lv_refr_now/lv_disp_get_default -> lv_refr_now/lv_display_get_default, lv_screen_active()); switch point arrays to lv_point_precise_t; adjust various visibility/flag and style calls across UI files to match v9. Also add small .claude settings entries for extra PlatformIO tasks. These updates align the codebase with LVGL v9 API changes and improve rendering/flush handling for the display.
Increase character height from 24 to 30 to match lv_font_montserrat_28 line_height (v9: 30px). Update char_height in lvgl_main_screen.cpp and adjust corresponding lv_obj_set_size calls in lvgl_updates.cpp (decimal and feet positions) to use height 30 so the main screen layout matches the font metrics.
@zjwhitehead zjwhitehead marked this pull request as ready for review March 27, 2026 01:37
@zjwhitehead zjwhitehead merged commit 9998313 into master Mar 27, 2026
7 checks passed
@zjwhitehead zjwhitehead deleted the lvglv9 branch March 27, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant